<!DOCTYPE html>
<?php
    //Datenbank einstellungen laden
    include("conf/conf.php");
    $dbConf = new Conf();
    $databaseURL = $dbConf->get_databaseURL();
    $databaseUName = $dbConf->get_databaseUName();
    $databasePWord = $dbConf->get_databasePWord();
    $databaseName = $dbConf->get_databaseName();
?>
<html> 
	<head> 
	<title>TU Braunschweig mobil</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; user-scalable=no;">
        <link rel="shortcut icon" href="themes/images/tubs_favicon.png" />
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
        <link rel="stylesheet" href="themes/TU-BS.css" />
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
	<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>      
</head> 

<body> 
    <div data-role="page" id="institute">
        <div data-role="header">
            <div class="ui-grid-a">
                    <div class="ui-block-a">
                <div id="header">
                    <a href="index-mobile.php" data-ajax="false"><img src="themes/images/siegel.png" width="71px" height="74px" alt="TU Siegel"></a>
                </div>
                    </div>
                <div class="ui-block-b">
            <div id="crumb">
                    <img src="themes/images/190-bank@2xw.png" height="36px" width="48px">
                </div>
                </div>
            </div>
            <div style="clear: both"></div>
            </div>
        <div data-role="content" data-theme="b">
           
            <ul data-role="listview" data-inset="true">
                <li>
                    <h3>1.Carl-Friedrich Gauß-Fakultät</h3>
                     <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Institutes..." data-filter-theme="d" data-inset="true">
		<?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                    or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                    or die("Error while connecting to database");
        
                $sql = "SELECT * FROM institute WHERE fakultaet = 1 ORDER BY name";

                $res = mysql_query($sql) or die("Error while connecting to database");
                $charset = mysql_set_charset("utf-8");
                echo $charset;
                
                 while ($row = mysql_fetch_object($res)) {
                     echo "<li><a href='".$row->link."'>".utf8_encode($row->name)."</a></li>";      
                 }
                ?>
                     </ul></li>
                     <li>
                <h3>2. Lebenswissenschaften</h3>
                <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Institutes..." data-filter-theme="d" data-inset="true">
		<?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                    or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                    or die("Error while connecting to database");
        
                $sql = "SELECT * FROM institute WHERE fakultaet = 2 ORDER BY name";

                $res = mysql_query($sql) or die("Error while connecting to database");
                
                 while ($row = mysql_fetch_object($res)) {
                     echo "<li><a href='".$row->link."'>".utf8_encode($row->name)."</a></li>";      
                 }               
                ?>
                </ul></li>
                <li>
                <h3>3. Architektur, Bauingenieurwesen und Umweltwissenschaften</h3>
                <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Institutes..." data-filter-theme="d" data-inset="true">
		<?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                    or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                    or die("Error while connecting to database");
        
                $sql = "SELECT * FROM institute WHERE fakultaet = 3 ORDER BY name";

                $res = mysql_query($sql) or die("Error while connecting to database");
                
                 while ($row = mysql_fetch_object($res)) {
                     echo "<li><a href='".$row->link."'>".utf8_encode($row->name)."</a></li>";      
                 }
                ?>
                </ul></li>
                <li>
                <h3>4. Maschinenbau</h3>
                <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Institutes..." data-filter-theme="d" data-inset="true">
		<?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                    or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                    or die("Error while connecting to database");
        
                $sql = "SELECT * FROM institute WHERE fakultaet = 4 ORDER BY name";

                $res = mysql_query($sql) or die("Error while connecting to database");
                
                 while ($row = mysql_fetch_object($res)) {
                     echo "<li><a href='".$row->link."'>".utf8_encode($row->name)."</a></li>";      
                 }
                ?>
                </ul></li>
                <li>
                <h3>5. Elektrotechnik, Informationstechnik, Physik</h3>
                <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Institutes..." data-filter-theme="d" data-inset="true">
		<?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                    or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                    or die("Error while connecting to database");
        
                $sql = "SELECT * FROM institute WHERE fakultaet = 5 ORDER BY name";

                $res = mysql_query($sql) or die("Error while connecting to database");
                
                 while ($row = mysql_fetch_object($res)) {
                     echo "<li><a href='".$row->link."'>".utf8_encode($row->name)."</a></li>";      
                 }
                ?>
                </ul></li>
                <li>
                <h3>6. Geistes- und Erziehungswissenschaften</h3>
                <ul data-role="listview" data-filter="true" data-filter-placeholder="Name des Institutes..." data-filter-theme="d" data-inset="true">
		<?php
                $connection = mysql_connect($databaseURL, $databaseUName, $databasePWord)
                    or die("Error while connecting to localhost");
                $db = mysql_select_db($databaseName, $connection)
                    or die("Error while connecting to database");
        
                $sql = "SELECT * FROM institute WHERE fakultaet = 6 ORDER BY name";

                $res = mysql_query($sql) or die("Error while connecting to database");
                
                 while ($row = mysql_fetch_object($res)) {
                     echo "<li><a href='".$row->link."' rel='external'>".utf8_encode($row->name)."</a></li>";      
                 }
                ?>
                </ul></li>
            </li>
            </ul>
            
        </div>
    </div>
</body>
</html>